#ifndef DEF_SHADER
#define DEF_SHADER

// --- Includes --------------------------------------------------------------

#ifdef WIN32
#include <GL/glew.h>
#else
#define GL3_PROTOTYPES 1
#include <GL3/gl3.h>
#endif

#include <iostream>

// --- Classes ---------------------------------------------------------------

class Shader
{
public:
	Shader() : m_ProgramObject(0), m_VertexShader(0)
		, m_FragmentShader(0), m_GeometryShader(0)
	{
	}


	~Shader()
	{
	}

	bool LoadVertexShader(const char *source);
#if CURRENT_RENDERER != ESGI_GLES_20
	bool LoadGeometryShader(const char *source);
#endif
	bool LoadFragmentShader(const char *source);

	bool Create();
	void Destroy();

	void Bind();
	void Unbind();

	inline GLuint GetProgram() const	{ return m_ProgramObject; }

private:

	// handle du program object
	GLuint m_ProgramObject;
	// handles des shaders
	GLuint m_VertexShader;
	GLuint m_FragmentShader;
	GLuint m_GeometryShader;
};

#endif // ESGI_SHADER